/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Aptech.Service;

import Aptech.DAL.MgLands;
import Aptech.DALInterface.LandsInterface;
import HibernateMappingPoJo.Lands;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author nkhoan
 */
public class SV_Lands {
    LandsInterface mgLand ;

    public SV_Lands(){
        mgLand = new MgLands();
    }

    public Lands[] getAllLand(){
        List list = mgLand.getAllLand();

        Lands[] listLand = new Lands[list.size()];
        if (list != null) {
            Iterator iter = list.iterator();
            int i = 0;
            while (iter.hasNext()) {
                Lands tptd = (Lands) iter.next();
                listLand[i] = tptd;
                i++;
            }
        }
        return listLand;
    }

      public void addLands(Lands land){
          mgLand.addLands(land);
      }

       public void editLands(Lands land){
           mgLand.editLands(land);
       }

       public void deleteLands(String id){
           mgLand.deleteLands(id);
       }
       
       public Lands getLandByID(String id){
          return mgLand.getLandByID(id);
       }



}
